import 'package:flutter/material.dart';

class MGroupHeader extends StatelessWidget {
  final String title;
  final bool showDivider;
  final Widget _header;

  MGroupHeader(this.title, {this.showDivider = true})
      : assert(title != null),
        _header = Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            children: <Widget>[
              Icon(Icons.stop, color: Colors.red),
              Text(
                title,
                style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
              ),
            ],
          ),
        );

  @override
  Widget build(BuildContext context) {
    return showDivider
        ? Column(
            children: <Widget>[
              Container(
                color: Colors.grey[200],
                height: 8.0,
              ),
              _header,
            ],
          )
        : _header;
  }
}
